<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.ridanlabs.professorwebsite.general.*" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="/static/css/gae.css" type="text/css" />
<title>Registration</title>
</head>
<body>
	<div id="content">
		<p>
			Welcome to the Professor Appengine App, <b> <sec:authentication property="principal.userEmail" /></b>. 
			Please enter your registration details in order to use the application.
		</p>

		<form:form id="register" method="post" modelAttribute="registrationForm">
			<fieldset>
				<form:label path="forename"> FirstName: </form:label>
				<form:errors path="forename" cssClass="fieldError" />
				<br />
				<form:input path="forename" />
				<br />

				<form:label path="surname"> LastName: </form:label>
				<form:errors path="surname" cssClass="fieldError" />
				<br />
				<form:input path="surname" />
				<br />
				
				<form:label path="schoolId"> School Id: </form:label>
				<form:errors path="schoolId" cssClass="fieldError" />
				<br />
				<form:input path="schoolId" />
				<br />

				<form:label path="userType">  User type: </form:label>
				<form:errors path="userType" cssClass="fieldError" />
				<br /> 
				<input type="radio" name="userType" value="<%= Authority.STUDENT.getAuthority() %>" checked="checked" /> Student 
				&nbsp;&nbsp;
				<input type="radio" name="userType" value="<%= Authority.PROFESSOR.getAuthority() %>" /> Professor 
				<br />
			</fieldset>
			<input style="width:9em" type="submit" value="Register"> &nbsp;
			
		</form:form>
	</div>
</body>
</html>
